import { Component }   from '@angular/core';
import { NavController, NavParams, IonicPage } from 'ionic-angular';
import { HttpServiceProvider } from '../../providers/http-service/http-service';
import { TradePage }   from '../trade/trade';
import { JoinPage }    from '../join/join';
import { ResultPage}   from '../result/result';


@IonicPage()
@Component({
  selector: 'page-actdetail',
  templateUrl: 'actdetail.html',
})
export class ActdetailPage {

    params: any = {};

  	constructor(public navCtrl: NavController, 
                public navParams: NavParams,
                public http: HttpServiceProvider) {

      this.detail(this.navParams.get('item')._id)
  	}

    detail(id){
      this.http.actDetail(id, (result) =>{
        this.params = result.detail
        console.log(this.params)
      })
    }

    result(){
      this.navCtrl.push(ResultPage)
    }
    
  	trade(){
  		this.navCtrl.push(TradePage)
  	}

    join(){
      this.navCtrl.push(JoinPage)
    }

  	ionViewDidLoad() {
    	console.log('ionViewDidLoad ActdetailPage');
  	}

}
